package com.baizhi.sync;

/**
 * 花钱的线程
 */
public class DrawThread extends Thread{
    //线程是花钱的线程，所以需要有一个银行卡对象
    private Account acc; //银行卡
    private double money; //每次花多少钱

    public DrawThread(String name, Account acc,double money) {
        super(name);
        this.acc = acc;
        this.money = money;
    }

    @Override
    public void run() {
        //调用取钱的方法
        acc.drawMoney(money);
    }
}
